package com.aos.erp.schools.remote.sys;

import com.aos.erp.common.bean.ResultBean;
import com.aos.erp.schools.remote.model.SynUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @program: erp
 * @description: 同步用户
 * @author: tanzhiyu
 * @create: 2018-11-19 11:18
 **/
@FeignClient(name = "${PERMISSION-SERVICE}")
public interface SynUserService {

    /**
     * 同步用户
     * @param synUser
     * @return
     */
    @PostMapping(value = "/sync/synUserInfo")
    ResultBean synUserInfo(@RequestBody SynUser synUser);

    /**
     * 同步用户删除
     *
     * @param appCode  应用appCode
     * @param username 用户账户
     * @return
     */
    @DeleteMapping(value = "/sync/deleteUser")
    ResultBean deleteUser(@RequestParam("appCode") String appCode, @RequestParam("username") String username);

    /**
     * 用户登录
     * @param appCode
     * @param username  账号
     * @param password  密码
     * @return
     */
    @PostMapping(value = "/user/login")
    ResultBean userLogin(@RequestParam("appCode") String appCode, @RequestParam("username") String username, @RequestParam("password") String password);

    /**
     * 用户退出
     * @param token 用户token
     * @return
     */
    @GetMapping(value = "/sync/logout")
    ResultBean userLoginOut(@RequestParam("token") String token);
}

